#{extends 'main.html' /}
#{set title:messages.get("application.register.text") /}

<div class="register">

<h1>&{'application.register.text'}</h1>

#{form @saveUser()}
    
    #{field 'user.name'}
       
            <label>&{'user.company'}:</label> <input type="text" name="${field.name}" size="16" value="${user?.name}"> *
            <span class="error">${field.error}</span>
       
    #{/field}
    <!--
    #{field 'user.description'}
       
            <label>Description:</label> <input type="text" name="${field.name}" size="16" value="${user?.description}"> *
            <span class="error">${field.error}</span>
       
    #{/field}
    
    #{field 'user.category.id'}
        
            <label>Category:</label>
            <select name="${field.name}"> 
				#{list items:categories, as:'category'} 
				    <option value="${category.id}">${category.categoryName}</option> 
				#{/list} 
			</select>  *
            <span class="error">${field.error}</span>
       
    #{/field}
    -->
    #{field 'user.address.city'}
      
            <label>&{'address.city'}:</label> <input type="text" name="${field.name}" size="16" value="${user?.address?.city}"> *
            <span class="error">${field.error}</span>
       
    #{/field}
    
    #{field 'user.address.zipCode'}
       
            <label>&{'address.zipcode'}:</label> <input type="text" name="${field.name}" size="16" value="${user?.address?.zipCode}"> *
            <span class="error">${field.error}</span>
       
    #{/field}
    
    #{field 'user.address.street'}
      
            <label>&{'address.street'}:</label> <input type="text" name="${field.name}" size="16" value="${user?.address?.street}"> *
            <span class="error">${field.error}</span>
       
    #{/field}
    
    #{field 'user.address.houseNumber'}
      
            <label>&{'address.house.number'}:</label> <input type="text" name="${field.name}" size="16" value="${user?.address?.houseNumber}"> *
            <span class="error">${field.error}</span>
      
    #{/field}
    
    #{field 'user.firstName'}
       
            <label>&{'user.firstName'}:</label> <input type="text" name="${field.name}" size="16" value="${user?.firstName}"> *
            <span class="error">${field.error}</span>
   
    #{/field}
    
    #{field 'user.lastName'}
     
            <label>&{'user.lastName'}:</label> <input type="text" name="${field.name}" size="16" value="${user?.lastName}"> *
            <span class="error">${field.error}</span>
    #{/field}
    
    #{field 'user.emailId'}
        
            <label>&{'user.email'}:</label> <input type="text" name="${field.name}" size="16" value="${user?.emailId}"> *
            <span class="error">${field.error}</span>
       
    #{/field}
    
    #{field 'user.username'}
     
            <label>&{'loginform.username'}:</label> <input type="text" name="${field.name}" size="16" value="${user?.username}"> *
            <span class="error">${field.error}</span>
       
    #{/field}
    
    #{field 'user.password'}
     
            <label>&{'loginform.password'}:</label> <input type="password" name="${field.name}" size="16" value="${user?.password}"> *
            <span class="error">${field.error}</span>
       
    #{/field}
    
    #{field 'verifyPassword'}
     
            <label>&{'user.verifyPassword'}:</label> <input type="password" name="${field.name}" size="16" value="${verifyPassword}"> *
            <span class="error">${field.error}</span>
      
    #{/field}    
    
		<button type="submit">&{'application.register.text'}</button>
           
 
#{/form}
</div>